package com.school.manager.service.impl;

import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
import com.school.manager.domaim.SysPermMenu;
import com.school.manager.entity.po.SysPermMenuPo;
import com.school.manager.entity.vo.SysPermMenuVo;
import com.school.manager.mapper.SysPermMenuMapper;
import com.school.manager.service.ISysPermMenuService;
import com.school.manager.utils.PageUtil;

import lombok.extern.slf4j.Slf4j;

/**
 * description：权限菜单关联业务实现类
 * date：2021/10/133:18 下午
 */

@Service
@Slf4j
public class SysPermMenuServiceImpl extends ServiceImpl<SysPermMenuMapper, SysPermMenu> implements ISysPermMenuService {
	
	@Autowired
    private SysPermMenuMapper sysPermMenuMapper;
	
	@Override
	public Page<SysPermMenuVo> page(SysPermMenuPo sysPermMenuPo) {
		QueryWrapper<SysPermMenu> queryWrapper = PageUtil.buildQueryWrapper(sysPermMenuPo, SysPermMenu.class);
        Page<SysPermMenu> page = new Page<>(sysPermMenuPo.getCurrent(), sysPermMenuPo.getSize());
        sysPermMenuMapper.selectPage(page, queryWrapper);
        return PageUtil.buildPage(page, SysPermMenuVo.class);
	}
	

}
